import { fetch, query } from 'api'
/**==========================
 *        租售服务
 ==========================*/
//  列表
const _list = type => {
  let param = {
    "Project_Main_list": {
      "TypeID": type,  //参数 分类ID  不传递获取全部项目
      "field": "ID,ProjectName,Img",
      "order": "Sort",
      "IsDelete": false
    }
  }
  return query(param)
}
// 详情
const _detail = id => {
  let param = {
    "Project_Main": {
      "ID": id,  //参数 项目ID
    }
  }
  return query(param)
}
// 推荐
const _recommend = (pid, mid, name, tel, profession, area, remark) => {
  return fetch(
    'WebApi.ashx?Act=SubmitProjectRecommend',
    { 
      ProjectID: pid,
      MemberID: mid,
      Name: name,
      Tel: tel,
      Profession: profession,
      Area: area,
      Remark: remark
    }
  )
}
export {
  _list,
  _detail,
  _recommend
}